﻿/*  
	------------------------------------------------------------------------
	 NQ Core Library
	
	 Homepage: http://www.awzhome.de/
	------------------------------------------------------------------------
	
	This Source Code Form is subject to the terms of the Mozilla Public
	License, v. 2.0. If a copy of the MPL was not distributed with this
	file, You can obtain one at http://mozilla.org/MPL/2.0/.
   
	The Original Code is code of NQ Core Library.

	The Initial Developer of the Original Code is Andreas Weizel.
	Portions created by the Initial Developer are
	Copyright (C) 2012 Andreas Weizel. All Rights Reserved.
	
	Contributor(s): (none)
	
	------------------------------------------------------------------------
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWZhome.NQ.Core.Testing
{
	/// <summary>
	/// Component loader, that simulates the loading of components and services by
	/// serving collections of dummy
	/// <see cref="AWZhome.NQ.Core.Testing.NQComponentInfo">NQComponentInfo</see>
	/// and <see cref="AWZhome.NQ.Core.Testing.NQServiceInfo">NQServiceInfo</see>
	/// instances.
	/// </summary>
	public class NQDummyComponentLoader : INQComponentLoader
	{
		private IEnumerable<INQComponentInfo> _componentInfos;
		private IEnumerable<INQServiceInfo> _serviceInfos;

		/// <summary>
		/// Constructor that initializes the NQDummyComponentLoader class.
		/// </summary>
		/// <param name="componentInfos">
		/// List of
		/// <see cref="AWZhome.NQ.Core.Testing.NQComponentInfo">NQComponentInfo</see>
		/// instances to be passed to the Service Manager.
		/// </param>
		/// <param name="serviceInfos">
		/// List of
		/// <see cref="AWZhome.NQ.Core.Testing.NQServiceInfo">NQServiceInfo</see>
		/// instances to be passed to the Service Manager.
		/// </param>
		public NQDummyComponentLoader(IEnumerable<INQComponentInfo> componentInfos, IEnumerable<INQServiceInfo> serviceInfos)
		{
			this._componentInfos = componentInfos;
			this._serviceInfos = serviceInfos;
		}

		#region INQComponentLoader Member

		public IEnumerable<INQComponentInfo> LoadComponentData()
		{
			return this._componentInfos;
		}

		public IEnumerable<INQServiceInfo> LoadServiceData()
		{
			return this._serviceInfos;
		}

		public bool LoadComponentAssemblies(INQComponentInfo componentInfo)
		{
			return true;
		}

		public string GetComponentPath()
		{
			return String.Empty;
		}

		#endregion
	}
}
